


* This do-file processes data on Kickstarter projects from Webrobots. The raw data
* are not included in this replication kit because disk space/storage restrictions
* but can be downloaded at https://webrobots.io/kickstarter-datasets/

* The resulting Stata dataset ("projects info.dta") is a filtered version of the
* Webrobots data, for those Kickstarter projects in the analysis sample of the paper.

clear
local csvfiles: dir "raw" files "*.csv"

set more off
foreach file of local csvfiles {
import delimited "raw/`file'", bindquote(strict) varnames(1) encoding(UTF-8) clear
keep id category slug name created_at creator launched_at deadline goal country currency fx_rate spotlight staff_pick state state_changed
split category, p(":")
split category2, p(",")
keep if category21 == "35"
drop category*
local name: subinstr local file ".csv" ""
save "raw/`name'.dta", replace
}

cd "raw"
local flist : dir . files "*.dta"
dis `"`flist'"'

foreach f in `flist' {
    append using "`f'"
}

duplicates drop

foreach f in `flist' {
    erase "`f'"
}

cd ..

save "projects info.dta", replace

















